package com.atguigu.cloud.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: huahua
 * @Date: 2024/6/3 0003
 * @Time: 14:35
 * @Description:
 */
@Configuration
public class FeignConfig {
    @Bean
    public Retryer myRetryer(){
        return Retryer.NEVER_RETRY; //默认配置不走重试策略

        //最大请求次数为3(1次默认+2次重试),初始间隔为100ms,重试最大间隔为1s
        //return new Retryer.Default(100,1,3);
    }

    @Bean
    public Logger.Level feignLoggerLevel(){
        return Logger.Level.FULL;
    }
}
